<?php
/* @description 主要母版 */
/* @var $this \yii\web\View */
/* @var $content string */

use yii\helpers\Html;
use yii\helpers\Url;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use frontend\assets\AppAsset;
use common\widgets\Alert;
use \common\models\Catalog;
use \common\models\Post;
use \common\models\Banner;
use \common\models\Links;
use yii\bootstrap\BootstrapAsset;
use yii\web\JqueryAsset;

//AppAsset::register($this);
$conf = Yii::$app->view->params['conf'];
$alias=Yii::$app->view->params['alias'];
?>
<?php $navItems = Catalog::getNavItems(2);?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
    <meta charset="<?= Yii::$app->charset ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link type="text/css" rel="stylesheet" href="<?=Yii::getAlias("@web")?>/css/style.css" />
    <script type="text/javascript" src="<?=Yii::getAlias("@web")?>/js/jquery.min.js"></script>
    <script type="text/javascript" src="<?=Yii::getAlias("@web")?>/js/jquery.SuperSlide.2.1.1.js"></script>
    <script type="text/javascript" src="<?=Yii::getAlias("@web")?>/js/kp.js"></script>
    <script type="text/javascript" src="<?=Yii::getAlias("@web")?>/js/page_box.js"></script>
    <?= Html::csrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>
    <?php if (isset($this->blocks['head'])): ?>
        <?= $this->blocks['head'] ?>
    <?php endif; ?>
</head>

<body>
<?php $this->beginBody() ?>
<div class="container">
    <div class="header">
        <div class="header_top clearfix">
            <div class="wrapper">
                <div class="logo_box pull-left">
                    <img src="<?=$conf['logo']?>">
                    <p>
                        <span class="word"><?=$conf['pinpai_brief']?></span>
                        <span><?=$conf['top_link']?></span>
                    </p>
                </div>
                <div class="pull-right">
                    <img src="<?=$conf['qrcode']?>">
                    <ul>
                        <li><?=$conf['header_telephone']?></li>
                        <li class="clearfix">
                    <span class="clearfix">
                        <a href="<?=$conf['alibaba']?>"><img class="qn" src="/images/qn.png"></a>
                        <a href="<?=$conf['weixin']?>"><img class="wx" src="/images/wx.png"></a>
                        <a href="<?=$conf['weibo']?>"><img class="wb" src="/images/wb.png"></a>
                    </span>
                            <span>了解详情</span>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <ul class="nav_box  clearfix">
            <div class="wrapper">
                <li class="first <?=empty($alias)?'on':''?>"><a href="/"><span>首&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;页</span><br>Home</a></li>
                <?php   for($i=0;$i<count($navItems);$i++){
                    $nav=$navItems[$i];
                ?>
                    <li class="<?=$alias==$nav['alias']?'on':''?> <?php if($i==count($navItems)-1){echo 'last';}?>"><a href="<?=Url::to(['/catalog','alias'=>$nav['alias']])?>"><span><?=$nav['name']?></span><br><?=$nav['us_name']?></a></li>
                <?php }?>
            </div>
        </ul>
    </div>
    <div class="online_box">
        <img src="/images/online.png">
        <div>
            <a href="http://wpa.qq.com/msgrd?V=3&uin=<?=$conf['QQ1']?>&Site=QQ客服&Menu=yes" target="_blank"><p><img src="/images/online_contact.png"><span>科牌-小燕</span></p></a>
            <a href="http://wpa.qq.com/msgrd?V=3&uin=<?=$conf['QQ2']?>&Site=QQ客服&Menu=yes" target="_blank"><p><img src="/images/online_contact.png"><span>科牌-小燕</span></p></a>
        </div>
    </div>
    <?= $content ?>
    <div class="footer">
        <span><img src="/images/location.png" style="width: 13px;height: 20px;">公司地址：<?=$conf['address']?></span>
        <span><img src="/images/phone.png" style="width: 15px;height: 14px;">咨询热线：<?=$conf['phone']?></span>
        <span><img src="/images/mail_17.png" style="width: 14px;height: 9px;">销售邮箱：<?=$conf['email']?></span>
        <p><?=$conf['copyright']?><span></span><?=$conf['record']?></p>
    </div>
</div>
<div id="backTop"></div>
<?php $this->endBody() ?>
<?php if (isset($this->blocks['js'])): ?>
    <?= $this->blocks['js'] ?>
<?php endif; ?>
</body>
<script>
    $(function () {
        var window_width=$(window).width();
        var count=0;
        var li_width=$(".banner .hd li").width()+16;
        $(".banner .hd li").each(function () {
            count++;
        });
        $(".banner .hd ul").width(li_width*count);
        $(".shop_display_box .choose >li").click(function () {
            var index=$(this).index();
            $(this).addClass("on").siblings().removeClass("on");
            $(".shop_display_box .display_info li").eq(index).show().siblings().hide();
        });
        $(".shop_display_box .choose >li").eq(0).trigger("click");
        $(window).scroll(function(){
            if($(window).scrollTop()>777){
                $(" .online_box").css("position","fixed").css("top","100px");
            }
            else{
                $(" .online_box").css("position","absolute").css("top","862px");
            }
        });
    })
</script>
</html>
<?php $this->endPage() ?>


<!--<body>-->
<?php //$this->beginBody() ?><!--<ul >-->
<!--<li> <a href="/">首页</a></li>-->
<?php
//$navItems = Catalog::getNavItems(2);
//    foreach($navItems as $nav){
//        echo ' <li>'. Html::a($nav['name'],Url::to(['/catalog', 'alias' => $nav['alias']]));
//        echo '<ul>';
//        foreach((array)$nav['childItems'] as $child){
//            echo '<li>'.Html::a($child['name'],Url::to(['/catalog', 'alias' => $child['alias']])).'</li>';
//        }
//        echo '</ul>';
//       echo '</li>';
//    }
//?>
<!-- </ul>-->
<?php // $content ?><!----><?php //$this->endBody() ?>
<?php //if (isset($this->blocks['js'])): ?>
<?php // $this->blocks['js'] ?>
<?php //endif; ?>
<!--</body>-->
<!--</html>-->
<?php //$this->endPage() ?>
